package org.liuyuantao.patterns.singleton;

/**
 * 这种方式基于classloder机制避免了多线程的同步问题,不过,instance在类装载时就实例化
 */
public class Singleton01 {
    private static Singleton01 instance = new Singleton01();

    private Singleton01() {
        System.out.println("创建了Singleton01实例!");
    }

    public static Singleton01 getInstance() {
        return instance;
    }
}  